package day4;

import java.io.File;

/**
 * ClassName：Test2
 *
 * @Author：小鱼
 * @Create：2025-08-21 10:17
 */
public class Test2 {
    public static void main(String[] args) {
        File file = new File("D:\\test");
//        System.out.println("创建目录是否成功"+file.mkdir());

        //遍历
        File[] filesList = file.listFiles();
        for (File file2:filesList) {
            System.out.println(file2.getName());
            if(file2.isDirectory()){
                File[] files = file2.listFiles();
                System.out.println(file2.getName()+"中有");
                for (File file3:files) {
                    System.out.println(file3.getName());

                }
            }
        }
    }
}
